package embuzzled.g5;

import java.awt.Color;

public class G5Puzzles extends PuzzleSet 
{
	public G5Puzzles()
	{
		super();
		
		/* Word Puzzle */
		CompositeWordPuzzle cloudPuzzle = new CompositeWordPuzzle("cloud");
		cloudPuzzle.solution = "Letters spell out the word 'cloud.'";
		int[] placementCloud = {Constants.PLACEMENT_HORIZONTAL, Constants.PLACEMENT_VERTICAL_DOWN};
		cloudPuzzle.setPlacementStrategies(placementCloud);
		cloudPuzzle.coloringStrategy = Constants.COLORING_RANDOM;
		
		/* Star Puzzle */
		SingleColorPuzzle starPuzzle = new SingleColorPuzzle(11,11);
		boolean[][] star = 
		{{false, false, false, false, false, true, false, false, false, false, false},
		 {false, true, false, false, false, true, false, false, false, true, false},
		 {false, true, true, false, true, true, true, false, true, true, false},
		 {false, false, true, true, true, true, true, true, true, false, false},
		 {false, false, true, true, true, true, true, true, true, false, false},
		 {false, false, false, true, true, true, true, true, false, false, false},
		 {false, false, false, true, true, true, true, true, false, false, false},
		 {false, false, true, true, true, false, true, true, true, false, false},
		 {false, true, true, true, false, false, false, true, true, true, false},
		 {false, true, false, false, false, false, false, false, false, true, false},
		 {true, false, false, false, false, false, false, false, false, false, true}
		};
		starPuzzle.setColorMap(star);
		starPuzzle.setColor(Color.YELLOW);
		starPuzzle.solution = "There is a yellow star.";
		starPuzzle.coloringStrategy = Constants.COLORING_DO_NOT_COLOR;
		
		/* Rain puzzle */
		CompositePuzzle rainPuzzle = new CompositePuzzle();
		rainPuzzle.solution = "A grey cloud is above rain.";
		PuzzleComponent rainCloudComponent = new PuzzleComponent(5,5);
		boolean[][] rainCloud = 
		{{false, true, false, true, false},
		 {true, true, true, true, false},
		 {false, true, true, true, true},
		 {true, true, true, true, true},
		 {true, true, false, true, false},
		};
		rainCloudComponent.setColorMap(rainCloud);
		rainCloudComponent.setColor(Color.GRAY);
		
		rainPuzzle.add(rainCloudComponent);
		
		boolean[][] rain = 
		{{true, false, false, false, false},
		 {true, false, true, false, false},
		 {false, false, true, false, true},
		 {false, false, false, false, true}
		};
		
		int raindrops = 3;
		for(int i = 0; i < raindrops; i++)
		{
			PuzzleComponent rainComponent = new PuzzleComponent(4, 5);
			rainComponent.setColorMap(rain);
			rainComponent.setColor(Color.BLUE);
			rainPuzzle.add(rainComponent);
		}
		
		int[] placementRain = {Constants.PLACEMENT_VERTICAL_DOWN};
		
		rainPuzzle.setPlacementStrategies(placementRain);
		
		rainPuzzle.coloringStrategy = Constants.COLORING_DO_NOT_COLOR;
		
		
		/* Add all puzzles */
		add(cloudPuzzle);
		add(starPuzzle);
		add(rainPuzzle);
		
		/* Set colors */
		//TODO - take in better list of colors
		Color[] possibleColors = {Color.BLUE, Color.PINK, Color.YELLOW, Color.CYAN, Color.MAGENTA};
		assignColors(possibleColors);
		
	}
}
